<?php
	require_once("../conexion/conexion.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
<link href="../Estilos/global.css" rel="stylesheet" type="text/css" />
<link href="../Estilos/local.css" rel="stylesheet" type="text/css" />
<link href="../Estilos/CssTabla3.css" rel="stylesheet" type="text/css" />

<!--<script src="../include_js/prototype.js" type="text/javascript"></script>-->
<script src="../include_js/jquery.js" type="text/javascript"></script>

</head>

<body>
<form name="form_lista_busqueda_decl" id="form_lista_busqueda_decl" method="post">
<?php
	extract($_POST);
	$op = $_POST['valor'];
	//echo "opcion= ".$op;
	if($op == '0')
	{
	?>
	<div class='groupbox'>
		<table width="100%" border="0" class="tres" cellpadding="0" cellspacing="0">
  
  <tr style="border:1px solid #6593C0;">
    <td width="35%" style="border:1px solid #6593C0;"><label style="color:#FFFFFF; font-weight:bold;">Titulo</label></td>
    <td width="29%" style="border:1px solid #6593C0;"><label style="color:#FFFFFF; font-weight:bold;">N&deg; Solicitud</label></td>
    <td width="18%" style="border:1px solid #6593C0;"><label style="color:#FFFFFF; font-weight:bold;">Categoria</label></td>
    <td width="18%" style="border:1px solid #6593C0;">&nbsp;</td>
  </tr>
  <tr style="border:1px solid #6593C0;">
    <td style="border:1px solid #6593C0;"><input type="text" name="txtTitulo1" size="40" /></td>
    <td style="border:1px solid #6593C0;"><input type="text" name="txtSolicitud" size="33" /></td>
    <td style="border:1px solid #6593C0;"><span style="color:#FFFFFF; font-weight:bold;">
      <select name="cmb_Categoria1" id="cmb_Categoria1">
        <option value="0">--Categoria--</option>
		<?php
            	$con = new Conexion();
        		$con2 = $con->conexionBD("fpproduccion");
                $sql = "select CatCod,CatTipo from categoria";
                $resultado = mysql_query($sql) or die ($con->error_mysql("Error en la consulta".mysql_error()));
				//$fila = mysql_num_rows($resultado);
				while ($row = mysql_fetch_row($resultado))
				{
					echo "<option value='".$row[0]."'>".$row[1]."</option>";
				}
                $con->cerrarBD();
	  ?>
      </select>
    </span></td>
    <td style="border:1px solid #6593C0;"><input type="button" name="btn_Buscar_Dia" id="btn_Buscar_Dia" value=" " class="buscar" /></td>
  </tr>
  <tr style="border:1px solid #6593C0;">
    <td style="border:1px solid #6593C0;">&nbsp;</td>
    <td style="border:1px solid #6593C0;">&nbsp;</td>
    <td style="border:1px solid #6593C0;">&nbsp;</td>
    <td style="border:1px solid #6593C0;">&nbsp;</td>
  </tr>
  <tr style="border:1px solid #6593C0;">
    <td style="border:1px solid #6593C0;" colspan="2"><span style="color:#FFFFFF; font-weight:bold;">Fecha Desde</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<span style="color:#FFFFFF; font-weight:bold;">Fecha Hasta</span></td>
    <td style="border:1px solid #6593C0;">&nbsp;</td>
  </tr>
  <tr style="border:1px solid #6593C0;">
    <td style="border:1px solid #6593C0;" colspan="2"><input name="txtFIni" type="text" id="txtFIni" size="10">&nbsp;<img src="imagen/img.gif" width="20" height="14" title="calendario" style="cursor: pointer; border: 1px solid green;" onmouseover="this.style.background='black';" onmouseout="this.style.background=''" onclick="popUpCalendar(txtFIni, form_lista_busqueda_decl.txtFIni, 'dd-mm-yyyy');" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<input name="txtFFin" type="text" id="txtFFin" size="10">&nbsp;<img src="imagen/img.gif" width="20" height="14" title="calendario" style="cursor: pointer; border: 1px solid green;" onmouseover="this.style.background='black';" onmouseout="this.style.background=''" onclick="popUpCalendar(txtFFin, form_lista_busqueda_decl.txtFFin, 'dd-mm-yyyy');" /></td>
    <td style="border:1px solid #6593C0;">&nbsp;</td>
    <td style="border:1px solid #6593C0;">&nbsp;</td>
  </tr>
</table>
</div>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
	<td><div id="capa1"></div></td>
</tr>
</table>
<?php
	}
	else
	{
		if($op == '1')
		{
		?>
			<div class='groupbox'>
		<table width="100%" border="0" class="tres" cellpadding="0" cellspacing="0">
  
  <tr style="border:1px solid #6593C0;">
    <td width="35%" style="border:1px solid #6593C0;"><label style="color:#FFFFFF; font-weight:bold;">Titulo</label></td>
    <td width="29%" style="border:1px solid #6593C0;"><label style="color:#FFFFFF; font-weight:bold;">C&oacute;digo Centro</label></td>
    <td width="18%" style="border:1px solid #6593C0;"><label style="color:#FFFFFF; font-weight:bold;">Categoria</label></td>
    <td width="18%" style="border:1px solid #6593C0;">&nbsp;</td>
  </tr>
  <tr style="border:1px solid #6593C0;">
    <td style="border:1px solid #6593C0;"><input type="text" name="txtTitulo2" size="40" /></td>
    <td style="border:1px solid #6593C0;"><input type="text" name="txtCodCentro" size="33" /></td>
    <td style="border:1px solid #6593C0;"><span style="color:#FFFFFF; font-weight:bold;">
      <select name="cmb_Categoria2" id="cmb_Categoria2">
        <option value="0">--Categoria--</option>
		<?php
            	$con = new Conexion();
        		$con2 = $con->conexionBD("fpproduccion");
                $sql = "select CatCod,CatTipo from categoria";
                $resultado = mysql_query($sql) or die ($con->error_mysql("Error en la consulta".mysql_error()));
				//$fila = mysql_num_rows($resultado);
				while ($row = mysql_fetch_row($resultado))
				{
					echo "<option value='".$row[0]."'>".$row[1]."</option>";
				}
                $con->cerrarBD();
	  ?>
      </select>
    </span></td>
    <td style="border:1px solid #6593C0;"><input type="button" name="btn_Buscar_Infa" id="btn_Buscar_Infa" value=" " class="buscar" /></td>
  </tr>
  <tr style="border:1px solid #6593C0;">
    <td style="border:1px solid #6593C0;">&nbsp;</td>
    <td style="border:1px solid #6593C0;">&nbsp;</td>
    <td style="border:1px solid #6593C0;">&nbsp;</td>
    <td style="border:1px solid #6593C0;">&nbsp;</td>
  </tr>
  <tr style="border:1px solid #6593C0;">
    <td style="border:1px solid #6593C0;" colspan="2"><span style="color:#FFFFFF; font-weight:bold;">Fecha Desde</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<span style="color:#FFFFFF; font-weight:bold;">Fecha Hasta</span></td>
    <td style="border:1px solid #6593C0;">&nbsp;</td>
    <td style="border:1px solid #6593C0;">&nbsp;</td>
  </tr>
  <tr style="border:1px solid #6593C0;">
    <td style="border:1px solid #6593C0;" colspan="2"><input name="txtFIni" type="text" id="txtFIni" size="10">&nbsp;<img src="imagen/img.gif" width="20" height="14" title="calendario" style="cursor: pointer; border: 1px solid green;" onmouseover="this.style.background='black';" onmouseout="this.style.background=''" onclick="popUpCalendar(txtFIni, form_lista_busqueda_decl.txtFIni, 'dd-mm-yyyy');" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<input name="txtFFin" type="text" id="txtFFin" size="10">&nbsp;<img src="imagen/img.gif" width="20" height="14" title="calendario" style="cursor: pointer; border: 1px solid green;" onmouseover="this.style.background='black';" onmouseout="this.style.background=''" onclick="popUpCalendar(txtFFin, form_lista_busqueda_decl.txtFFin, 'dd-mm-yyyy');" /></td>
    <td style="border:1px solid #6593C0;">&nbsp;</td>
    <td style="border:1px solid #6593C0;">&nbsp;</td>
  </tr>
</table>
</div>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
	<td><div id="capa2"></div></td>
</tr>
</table>
<?php
		}
	}
?>
</form>
</body>
<script>
$('#btn_Buscar_Dia').click(function() 
{ 
        $.ajax({
            type: 'POST',
            url: 'Produccion/carga_busqueda_decl_1.php',
            data: $('#form_lista_busqueda_decl').serialize(),
            success: function(data) {
                $('#capa1').html(data);
            }
        })
});
$('#btn_Buscar_Infa').click(function() 
{ 
        $.ajax({
            type: 'POST',
            url: 'Produccion/carga_busqueda_decl_2.php',
            data: $('#form_lista_busqueda_decl').serialize(),
            success: function(data) {
                $('#capa2').html(data);
            }
        })
});
</script>
</html>
